From ac484c2721398175946431d3b2e8b3ce76391807 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 10 Mar 2007 08:37:51 +0000 Subject: [PATCH] (PC-do-completion): Bind dirlength to nil to avoid that buffer contents get erased during completion. --- lisp/complete.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/complete.el b/lisp/complete.el index 104f3789403..ce5094d1aef 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -417,7 +417,10 @@ of `minibuffer-completion-table' and the minibuffer contents.") (pred minibuffer-completion-predicate) (filename (funcall PC-completion-as-file-name-predicate)) (dirname nil) ; non-nil only if a filename is being completed - (dirlength 0) + ;; The following used to be "(dirlength 0)" which caused the erasure of + ;; the entire buffer text before `point' when inserting a completion + ;; into a buffer. + dirlength (str (buffer-substring beg end)) (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) (ambig nil) -- 2.30.2